"use strict";

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    const fakeData = [
      {
        name: "前端开发",
        rank: 1,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
      {
        name: "后端开发",
        rank: 2,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
      {
        name: "数据库",
        rank: 3,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
      {
        name: "设计&建模",
        rank: 4,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
      {
        name: "运维",
        rank: 5,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
      {
        name: "产品",
        rank: 6,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
      {
        name: "项目",
        rank: 7,
        createdAt: new Date(),
        updatedAt: new Date(),
      },
    ];
    try {
      await queryInterface.bulkInsert("Categories", fakeData, {});
    } catch (error) {
      console.log('seed error', error);
    }
  },

  async down(queryInterface, Sequelize) {
    await queryInterface.bulkDelete("Categories", null, {});
  },
};
